#!/usr/bin/python
import sys
from socket import *
serverHost = "119.161.130.76" # servername is localhost
serverPort = 2345 # use arbitrary port > 1024
s = socket(AF_INET, SOCK_STREAM) # create a TCP socket
s.connect((serverHost, serverPort)) # connect to server on the port
binf=open("protocal-1004.bin",'rb')
str=binf.read()
s.send(str)
print "send successfully"
for i in range (0,4):
    data = s.recv(2048) # receive up to 1K bytes
    str1 = data.decode('utf-16-le')
    str2 = str1.encode('utf-8')
    print "recv data",str2


